<?php

namespace app\controllers\device;

use app\common\base\CommonController;

class DeviceDataController extends CommonController
{

    // TODO：新版小程序数据概览页面数据请求
    /**
     *  array ph, cod, oxygen, nh4n, phosphorus,
     *              colorDe, turbidity, conductivity, flow, tem
     */
    public function actionGetTotalData()
    {
        $this->rules = [
            [['deviceId'], 'required'],
            [['deviceId'], 'integer']
        ];
        $inputs = $this->validate();

        $data = parent::callModuleService('device', 'DeviceDataService', 'getTotalData', $inputs['deviceId']);

        return [
            'success' => 1,
            'data' => $data,
        ];
    }
}
